package com;

import com.ys.util.Duanxin;
import com.ys.util.alb.SendSms;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.junit.Test;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class as {
    public static void main(String[]args){
//        String[] a = new String[]{"admin","admina","admins","admind","adminf","adming"};
//        for (int i = 0; i < a.length; i++) {
//            String name = UUID.randomUUID().toString().replace("-","");
//            String names = new Md5Hash(a[i],name).toString();
//            System.out.println(name+"----"+names);
//        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String today=sdf.format(new Date());
        String nian = today.substring(0,4);
        String yue = today.substring(today.indexOf("-")+1,today.lastIndexOf("-"));
        System.out.println(nian);
        System.out.println(yue);
        System.out.println("======================================");
        Integer nian1 = 0;
        Integer yue1 =0;
        //当前月份=01的时候，月份就等于2018-12
        if(yue=="01"){
            nian1 = Integer.parseInt(nian)-1;
            yue1 = 12;
        }else{
            nian1 = Integer.parseInt(nian);
            yue1 = Integer.parseInt(yue)-1;
        }
        System.out.println(nian1);
        System.out.println(yue1);
    }

    @Test
    public void  as(){
//        Duanxin as = new Duanxin();
//        as.duanXin("18832017384","000");


        Map<String,String> map = new HashMap();
        SendSms sendSms = new SendSms();
        map.put("mobile","18832017384");
        map.put("code","0000");
        map.put("yx","翱翔医药系统");
        sendSms.send(map);
    }
}
